import request from '@/utils/request'
// 获取目录列表
export function getDirectoryList(params) {
  return request({
    url: '/directorys',
    method: 'GET',
    params
  })
}

// 添加目录
export function getDirectory(data) {
  return request({
    url: '/directorys',
    method: 'POST',
    data
  })
}

// 目录状态
export function StateDirectory(id, state) {
  return request({
    url: `/directorys/${id}/${state}`,
    method: 'POST'
  })
}
// 删除
export function delDirectory(id) {
  return request({
    url: `/directorys/${id}`,
    method: 'DELETE'
  })
}

// 学科列表
export function getsubjectName() {
  return request({
    url: '/subjects/simple',
    method: 'GET'
  })
}
// 修改
export function editDirectory(data) {
  return request({
    url: `/directorys/${data.id}`,
    method: 'PUT',
    data
  })
}
